# HG changeset patch # User alexrayne # Date 1752765089 -10800 # Thu Jul 17 18:11:29 2025 +0300 # Branch stable # Node ID 155bfffa6b80bd997349b5be8051f96f5bd72b6d # Parent 98f3571f3f4485949b140ffe450ee288b743d2bb update: --subs=narrow provides update subrepos only for desired parent-repo revision by default, hg-subrepos pull all changes diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -7501,6 +7501,7 @@ (b'm', b'merge', None, _(b'merge uncommitted changes')), (b'd', b'date', b'', _(b'tipmost revision matching date'), _(b'DATE')), (b'r', b'rev', b'', _(b'revision'), _(b'REV')), + (b'' , b'subs', b'', _(b'subrepo pulling style'), _(b'subs')), ] + mergetoolopts, _(b'[-C|-c|-m] [-d DATE] [[-r] REV]'), @@ -7578,6 +7579,8 @@ hint=_(b'for example: hg update ".::"'), ) + setattr(repo, 'opt_subs', opts.get('subs')) + if rev is None or rev == b'': rev = node diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -792,13 +792,18 @@ self._cachestorehash(srcurl) else: self.ui.status( - _(b'pulling subrepo %s from %s\n') - % (subrelpath(self), urlutil.hidepassword(srcurl)) + _(b'pulling subrepo %s from %s rev %s\n') + % (subrelpath(self), urlutil.hidepassword(srcurl), revision) ) cleansub = self.storeclean(srcurl) peer = getpeer() + heads = None + if hasattr(parentrepo, 'opt_subs'): + if parentrepo.opt_subs == b'narrow': + heads = [bin(revision)] + self._repo.opt_subs = parentrepo.opt_subs try: - exchange.pull(self._repo, peer) + exchange.pull(self._repo, peer, heads = heads ) finally: peer.close() if cleansub: _______________________________________________ Mercurial-devel mailing list Mercurial-devel@lists.mercurial-scm.org https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel